Compiler Design
Q33.
A symbol table of length 152 is processing 25 entries at any instant. What is occupation density?Q34.
Consider the following statements. I. Symbol table is accessed only during lexical analysis and syntax analysis. II. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the run-time environment. III. Errors violating the condition 'any variable must be declared before its use' are detected during syntax analysis. Which of the above statements is/are TRUE?Q35.
The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?Q36.
The number of tokens in the following C code segment is switch(inputvalue) { case 1 : b =c*d; break; default : b =b++; break; }Q37.
A lexical analyzer uses the following patterns to recognize three tokens T_{1}, T_{2}, \; and \; T_{3} over the alphabet {a,b,c}. T_{1}:a?(b|c)^* a T_{2}:b?(a|c)^* b T_{3}:c?(b|a)^* c Note that 'x?' means 0 or 1 occurrence of the symbol x. Note also that the analyzer outputs the token that matches the longest possible prefix. If the string bbaacabc is processed by the analyzer, which one of the following is the sequence of tokens it outputs?Q38.
The number of tokens in the following C statement is printf("i=%d, &i=%x", i, &i);Q39.
In a two-pass assembler, resolution of subroutine calls and inclusion of labels in the symbol table is done during